﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkBox.aspx.cs" Inherits="ExtendedWorkFlow.Pages.WorkBox"
    MasterPageFile="~/umbraco/masterpages/umbracoPage.Master" %>

<%@ Register TagPrefix="UmbracoControls" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="UmbracoControls" Namespace="umbraco.controls" Assembly="umbraco" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="umbraco.NodeFactory" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .workbox
        {
            width: 100%;
        }
        .workbox td
        {
            padding: 3px;
            vertical-align: top;
        }
        .workbox .action-button
        {
            height: 18px;
        }
        .workbox .action-button img
        {
            float: left;
            margin-right: 5px;
        }
    </style>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
    <umbracocontrols:tabview id="tabContent" runat="server" width="552px" height="692px" />
    <asp:Repeater ID="rptWorkFlowStates" runat="server">
        <ItemTemplate>
            <umbracocontrols:pane id="ppState" runat="server" text='<%# this.State.Name %>'>
                <asp:Repeater ID="rptWorkFlowBox" runat="server" DataSource='<%# this.GetDocuments((DataRowView)Container.DataItem) %>'>
                    <ItemTemplate>
                        <table style="width: 100%;" class="workbox">
                            <tr>
                                <td>
                                    <asp:Label runat="server" Text='<%# ((DataRow)Container.DataItem)["name"] %>' />
                                </td>
                                <td style="width: 120px;">
                                    <asp:Label runat="server" Text='<%# string.Format("{0:dd/MM/yyy HH:mm}", ((DataRow)Container.DataItem)["createDate"]) %>' />
                                </td>
                                <td style="width: 120px;">
                                    <asp:Label runat="server" Text='<%# string.Format("{0:dd/MM/yyy HH:mm}", ((DataRow)Container.DataItem)["updateDate"]) %>' />
                                </td>
                                <td style="width: 100px;">
                                    <asp:Label runat="server" Text='<%# ((DataRow)Container.DataItem)["userName"] %>' />
                                </td>
                                <td style="width: 140px;">
                                    <asp:HyperLink ID="lnkDiffrences" runat="server" NavigateUrl='<%# this.GetDiffrenceModalWindowUrl((DataRow)Container.DataItem) %>'>
                                    Differences
                                    </asp:HyperLink>
                                </td>
                                <td style="width: 120px; text-align: right;">
                                    <asp:Repeater ID="rptActions" runat="server" DataSource='<%# this.GetActions((DataRow)Container.DataItem) %>' OnItemCreated="rptActions_ItemCreated">
                                        <ItemTemplate>
                                            <div class="action-button">
                                                <img src="/umbraco/images/umbraco/add.png" alt="Action" />
                                                <asp:LinkButton ID="lnkAction" runat="server" CommandName='<%# this.GetWorkFlowId((Repeater)Container.Parent) %>'
                                                    ToolTip='<%# this.GetActionTooltip((Node)Container.DataItem) %>' OnClick="btnAction_Click"
                                                    CommandArgument='<%# ((Node)Container.DataItem).Id %>'>                                                   
                                                    <%# ((Node)Container.DataItem).Name %>
                                                    </asp:LinkButton>
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:Repeater>
            </umbracocontrols:pane>
        </ItemTemplate>
    </asp:Repeater>
</asp:Content>
